<template>
    <my-ref
        v-if="table"
        url="/sys/api-router-define/list"
        v-model="table"
        @loaded="procData"
        :multi="$props.multi"
        :page-size="10"
        ref="list"
        name="Api路由定义"
        :store="true"
        v-bind="$attrs"
        @change="v=>$emit('change',v)"
        :readOnly="$props.readOnly"
    >
        <el-table-column align="center" label="目标地址" prop="uri"></el-table-column>
        <el-table-column align="center" label="旧路径" prop="oldPath"></el-table-column>
        <el-table-column align="center" label="新路径" prop="newPath"></el-table-column>
        <el-table-column align="center" label="备注" prop="remark"></el-table-column>
        <template #query="scope">
        </template>
        <template #button>
            <el-button>选择Api路由定义</el-button>
        </template>
    </my-ref>
</template>

<script setup>
/**
 * Created by CodeGenerator at 2024-02-06 00:22:31
 */



defineOptions({
    name: "ref-api-router-define",
    inheritAttrs: true,
});

//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({});


const $props = defineProps({
    readOnly : { type: Boolean },
    multi : { type: Boolean }
});


const $model = defineModel({ type: [Object,Array] });



const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);

const table = $computed({ get() {
        return $model;
    },set(v){
        var v = Object.assign({}, v);
        $emit("update:modelValue", v);
    } });

const procData = function(res, op) {
    let json = res.data.data;
    json.forEach(it => {
//如果是组合实体，设置 it.id=...
    });
};





</script>

<style scoped lang="scss">
</style>